//
//  SYNavigationItemBtnView.m
//  Foodie
//
//  Created by yunqi on 16/3/10.
//  Copyright © 2016年 SY. All rights reserved.
//

#import "SYNavigationItemBtnView.h"

@implementation SYNavigationItemBtnView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(id)init
{
    if (self=[super init]) {
        _badgeView=[[UILabel alloc]init];
        _badgeView.font=UIFontWithBoldSize(10);
        _badgeView.frame=CGRectMake(0, 0, 6, 6);
        _badgeView.backgroundColor=[UIColor redColor];
        _badgeView.layer.masksToBounds=YES;
        _badgeView.textAlignment=NSTextAlignmentCenter;
        _badgeView.textColor=[UIColor whiteColor];
        _badgeView.layer.cornerRadius=_badgeView.width/2;
        _badgeView.hidden=YES;
        [self addSubview:_badgeView];
    }
    return self;
}
-(void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _badgeView.frame=CGRectMake(self.width+1, 7, _badgeView.width, _badgeView.height);
}

@end
